CC = g++
CFLAGS = -Wall

ifeq ($(shell uname),Darwin)
	LIBS = -framework OpenGL -framework GLUT -lm
else
	LIBS = -lglut -lm
endif

all: ship.o main.o imagehandler.o
	$(CC) $(CFLAGS) ship.o main.o imagehandler.o -o space_invaders $(LIBS)
	

ship.o: ship.cpp ship.h imagehandler.h
	$(CC) $(CFLAGS) -c ship.cpp
	
main.o: main.cpp ship.h imagehandler.h
	$(CC) $(CFLAGS) -c main.cpp

imagehandler.o: imagehandler.cpp imagehandler.h
